@color-success: #21ba45 !important;
@color-warning: #fbbd08 !important;
@color-danger: #db2828 !important;
@progress-color: @color-success;
@progress-color-secondary: #00b5ad;
//@progress-border-radius: 0;
@progress-background-color: #eee;
@progress-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;

@metric-margin: 0.25rem;

html, body, .vertical-center {
  width: 100%;
  height: 100%;
}

.app-header{
  padding-top: 2rem;
  padding-bottom: 1rem;
}
.app-footer{
  text-align: center;
  padding: 1em;
}

.vertical-center {
  display: table;
  & > .inner {
    display: table-cell;
    vertical-align: middle;
  }
}

.metric {
  display: inline-block;
  font-size: 1.6em;
  line-height: 1.2em;
  margin: @metric-margin;
  text-align: right;
  max-width: 90px;
  &.wide {
    max-width: 200px;
  }
  .header {
    font-size: 0.45em;
    line-height: 1.0em;
    color: rgba(0, 0, 0, .6);
  }
  .success {
    color: @color-success;
  }
  .warning {
    color: @color-warning;
  }
  .danger {
    color: @color-danger;
  }
}

.metric-group {
  display: inline-block;
  margin: @metric-margin;
  border-radius: .28571429rem;
  border: 1px solid rgba(34, 36, 38, .15);
  box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .15);
  > .header {
    font-size: 0.8em;
    line-height: 1.0em;
    color: rgba(0, 0, 0, .6);
    font-weight: 700;
    background-color: #e8e8e8;
    border-radius: .21428571rem .21428571rem 0 0;
    padding: .25em @metric-margin;
    .sub {
      float: right;
      font-weight: normal;
      font-size: 0.9em;
    }
  }
  &.success {
    border: 1px solid @color-success;
    > .header {
      background-color: @color-success;
      color: #fff;
    }
  }
  &.warning {
    border: 1px solid @color-warning;
    > .header {
      background-color: @color-warning;
      color: #fff;
    }
  }
  &.danger {
    border: 1px solid @color-danger;
    > .header {
      background-color: @color-danger;
      color: #fff;
    }
  }
}

.metric-container {
  margin: -@metric-margin;
}

.metric-wrapper {
  display: inline-block;
}

.ui.host.header {
  display: inline-block;
  margin: @metric-margin;
  .sub.header {
    font-size: 0.6em;
  }
}

.host-group {
  margin-top: 2em;
  margin-bottom: 2em;
}

.host.segment {
  .bar {
    border-left: 1px solid rgba(34, 36, 38, .15);
    border-right: 1px solid rgba(255, 255, 255, .1);
    width: 0;
    height: 4em;
    display: inline-block;
    vertical-align: bottom;
    margin-left: @metric-margin;
    margin-right: @metric-margin;
  }
}

.ui.slim.divider {
  margin: 0.4rem 0;
}

.host-error {
  display: inline-block;
  font-size: 1.4em;
  color: @color-danger;
  vertical-align: top;
  margin: 0.9em @metric-margin;
}

.percent-bar {
  display: flex;
  .bar {
    flex: 1;
  }
  .label {
    margin-right: .4em;
  }
  .number {
    width: 3em;
    margin-left: .4em;
    text-align: right;
  }
  &.inline{
    display: inline-flex;
  }
}

.percent-bar > .bar, .multi-percent-bar {
  background-color: @progress-background-color;
  //border-radius: @progress-border-radius;
  box-shadow: @progress-box-shadow;
  position: relative;
  height: 1em;
  margin-top: 0.2em;
  .inner, .inner-secondary {
    display: inline-block;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    //border-radius: @progress-border-radius;
    transition: width 0.5s ease-out, left 0.5s ease-out;
  }
  .inner{
    background-color: @progress-color;
  }
  .inner-secondary{
    background-color: @progress-color-secondary;
  }
}

.multi-percent-bar .inner {
  //border-radius: 0;
  //&:first-child{
  //  border-radius: @progress-border-radius 0 0 @progress-border-radius;
  //}
  //&:last-child{
  //  border-radius: 0 @progress-border-radius @progress-border-radius 0;
  //}
  &.mem-buffers {
    background-color: lighten(@progress-color, 20%);
  }
  &.mem-cached {
    background-color: lighten(@progress-color, 40%);
  }
}

.legend{
  text-align: center;
  margin-top: 0.5em;
  .header{
    font-weight: bold;
  }
  .items{
    margin: 0 -0.5em;
    .item{
      display: inline-block;
      margin: 0 0.5em;
      .color-block{
        display: inline-block;
        width: 1em;
        height: 1em;
        //border-radius: @progress-border-radius;
        background-color: @progress-background-color;
      }
    }
  }
}

.legend .color-block{
  &.mem-used, &.disk-used{
    background-color: @progress-color;
  }
  &.mem-buffers {
    background-color: lighten(@progress-color, 20%);
  }
  &.mem-cached {
    background-color: lighten(@progress-color, 40%);
  }
}

.table-responsive{
  overflow-x: auto;
  width: 100%;
}

.centered-text{
  text-align: center;
}

.grid.cpu-bars{
  padding-top: 1rem;
  padding-bottom: 1rem;
  &>.column:not(.row){
    padding-top: 0;
    padding-bottom: 0;
  }
}
.muted-text{
  opacity: .45!important;
}

.host-switch{
  .percent-bar.inline > .bar{
    width: 40px;
  }
}

.clients-table{
  margin-bottom: 1em;
}

.init-box{
  opacity: 0;
  transition: opacity 1s ease-in;
  &.active{
    opacity: 1.0;
  }
}

.user-info{
  position: absolute;
  top: 0;
  right: 0;
  padding: 12px;
}